StringScanner.ScanSmatch Function

Syntax

Result_Flag as L = ScanSmatch as C(pattern as c)

Arguments

Result_Flag

True indicates that the Find_Text exists in the buffer.

pattern

The text that you want to find in the buffer. You may use the "?" (single character) and "*" (any number of characters) expressions.

Description

Skip until a pattern is found, and scan over it . Return text that matches the pattern.

Discussion

The <StringScanner>.ScanSmatch() function indicates whether Find_Text can be found between the offset and the end of the buffer. The offset is positioned immediately after Find_Text.

Example

dim scanner as P
dim txt as C
txt = <<%text%
This is wonderful text
written by a great writer
%text%
scanner = stringscanner.create(txt)
? scanner.scansmatch("der**l")
= "derful"
? scanner.GetToOffset()
= "This is wonderful"
? scanner.GetRemainder()
=prose written
by a technical writer of note.

See Also